{extend name='table'}

{block name="content"}
<div class="layui-tab layui-tab-card">
    <ul class="layui-tab-title">
        {foreach ['0'=>lang('总览'),'1'=>lang('供货商')] as $k=>$v}
        {if isset($type) and $type eq $k}
        <li data-open="{:url('index')}?type={$k}" class="layui-this">{$v}</li>
        {else}
        <li data-open="{:url('index')}?type={$k}">{$v}</li>
        {/if}
        {/foreach}
    </ul>
    <div class="layui-tab-content">
        <table id="DataAddTable" data-url="{:sysuri('index')}" data-target-search="form.form-search"></table>
    </div>
</div>

<script>
    $(function () {
        $('#DataAddTable').layTable({
            even: true, height: 'full',
            where: {type: '{$type|default="index"}'},
            cols: [[
                {field: 'addtime', title: '{:lang("日期")}', minWidth: 100, align: 'center', templet: '<div>{{d.addtime||"-"}}</div>'},
                {field: 'merchname', title: '{:lang("供货商名称")}', minWidth: 100, align: 'center', templet: '<div>{{d.merchname||"-"}}</div>'},
                {field: 'username', title: '{:lang("账号")}', minWidth: 100, align: 'center', templet: '<div>{{d.username||"-"}}</div>'},
                {field: 'merchno', title: '{:lang("编码")}', align: 'center', minWidth: 100},
                {
                    field: 'logo', title: '{:lang("LOGO")}', width: 80, align: 'center', templet: function (d) {
                        if (!d.logo) return '-';
                        return layui.laytpl('<div class="headimg headimg-ss shadow-inset margin-0" data-tips-image data-tips-hover data-lazy-src="https://qny.soo58.com/{{d.logo}}"></div>').render(d);
                    }
                },
                {field: 'realname', title: '{:lang("联系人")}', align: 'center', minWidth: 80},
                {field: 'mobile', title: '{:lang("联系电话")}', align: 'center', minWidth: 80},
                {field: 'num', title: '{:lang("新增商品数")}', align: 'center', minWidth: 80},
            ]]
        });
    });
</script>
{/block}